package cn.humaohua.study.yanmo_design_pattern.ch04.v1;

import java.util.List;

/**
 * 适配器模式
 */
public class Main {

    public static void main(String[] args) {
        test1();
        test2();
    }

    /**
     * 测试日志文件写入
     */
    private static void test1() {

        LogFileOperateApi logFileOperate = new LogFileOperate(null);
        logFileOperate.writeLogFile(LogModelUtil.INSTANCE.genLogModel());

    }

    /**
     * 测试日志文件读取
     */
    private static void test2() {
        LogFileOperateApi logFileOperate = new LogFileOperate(null);
        List<LogModel> list = logFileOperate.readLogFile();
        for (LogModel logModel : list)
            System.out.println(logModel.toString());
    }

}
